<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>回收员审核</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../layui/css/layui.css" media="all">
    <script type="text/javascript" src="../js/jquery.min.js"></script>
    <script type="text/javascript" src="../jquery-easyui-1.5.3/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="../jquery-easyui-1.5.3/easyui-lang-zh_CN.js"></script>
    <script src="../js/jquery-3.1.0.min.js"></script>
    <script type="text/javascript" src="../js/jquery.qrcode.min.js"></script>
    <script src="../layui/layui.js" charset="utf-8"></script>
    <script src="../js/public.js"></script>
    <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->

    <style>
        .layui-input {
            width: 200px;
        }

        .layui-form-item {
            margin-left: 25px;
        }

        .readonly {
            color: #4E5465;
        }

        .layui-form-selected {
            width: 200px;
        }

        .layui-unselect {
            width: 200px;
        }
    </style>
</head>

<body>
<form class="layui-form" action="">
    <div class="layui-form-item" style="margin-top: 10px">
        <label class="layui-form-label">姓名：</label>
        <div class="layui-input-block">
            <input type="text" name="name" class="layui-input readonly" id="name" readonly class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">电话：</label>
        <div class="layui-input-block">
            <input type="text" name="phone" class="layui-input readonly" id="phone" readonly class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">申请时间：</label>
        <div class="layui-input-block">
            <input type="text" name="creattime" id="creattime" class="layui-input readonly" readonly class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">审核：</label>
        <div class="layui-input-block">
            <select name="status" lay-filter="status" class="layui-input" id="status">
                <option value="9"> -- 请选择 -- </option>
                <option value="0">审核中</option>
                <option value="1">通过</option>
                <option value="2">拒绝</option>
            </select>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">审核意见：</label>
        <div class="layui-input-block">
            <input type="text" name="remark" id="remark" class="layui-input" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-input-block">
            <button type="submit" class="layui-btn" lay-submit="" lay-filter="demo1">立即提交</button>
            <!--<button type="reset" class="layui-btn layui-btn-primary">重置</button>-->
        </div>
    </div>
</form>

</body>
<script>
    layui.use(['form'], function () {
        var form = layui.form
            , layer = layui.layer
            , $ = layui.jquery

        var uid = getPageParam("id");
        var name = getPageParam("name");
        var phone = getPageParam("phone");
        var creattime = getPageParam("creattime");
        var status = getPageParam("status");


        $("#name").val(name);
        $("#phone").val(phone);
        $("#creattime").val(creattime);
        $("#status").val(status);

        //重新渲染select
        form.render('select');


//监听提交
        form.on('submit(demo1)', function (data) {
            $.ajax({
                type: "post",
                dataType: "json",
                url: "/refuse-web/admin/updateappuser",
                async: true,
                data: {
                    id: uid,
                    status: $("#status").val(),
                    remark:$("#remark").val()
                },
                success: function (data) {
                    var map = data;
                    if (map.code == 0) {
                        layer.msg("操作成功",{icon:6,time:1000},function () {
                            layer.closeAll();
                            parent.location.reload();
                        })
                    } else {
                        layer.msg("操作成功",{icon:5,time:1000},function () {
                            layer.closeAll();
                            parent.location.reload();
                        })
                    }
                },
                error: function (msg) {
                    layer.msg("服务器请求失败",{icon:5,time:1000},function () {
                        layer.closeAll();
                        parent.location.reload();
                    })
                }
            });
            return false;
        })
    });
</script>

</html>